/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cassys.delegates;

import cassys.dataaccess.DAOException;
import cassys.datatransferobjects.AssessmentDTO;
import cassys.datatransferobjects.AssessmentItemsDTO;
import cassys.ejb.sessionbean.AssessmentBean;
import cassys.ejb.sessionbean.AssessmentBeanRemote;
import cassys.servicelocator.ServiceLocator;
import java.util.ArrayList;

/**
 *
 * @author Priyanka
 */
public class AssessmentDelegate {

    private AssessmentBeanRemote assessmentBean = null;

    public AssessmentDelegate() {

        assessmentBean = (AssessmentBeanRemote) ServiceLocator.getInstance().lookupAssessmentBean();

    }

    public void createAssessment(AssessmentDTO dto) throws DAOException {
        assessmentBean.insertAssessment(dto);

    }

    public void deleteAssessment(AssessmentDTO dto) throws DAOException {
        assessmentBean.deleteAssessment(dto);

    }

    public ArrayList<AssessmentDTO> getAllAssessmentByModule(String moduleCode) throws DAOException {
        return assessmentBean.getAllAssessmentByModule(moduleCode);

    }

    public void updateAssessment(AssessmentDTO dto) throws DAOException {
        assessmentBean.insertAssessment(dto);

    }
    
    public AssessmentDTO findAssessment(String assessmentId) throws DAOException{
        return assessmentBean.findAssessment(assessmentId);
    }
    
    public ArrayList<AssessmentDTO> findAllAssessment() throws DAOException{
        return assessmentBean.findAllAssessments();
    }
    
    public ArrayList<AssessmentDTO> findAllAssessmentById(String assessmentId) throws DAOException{
        return assessmentBean.findAllAssessmentsById(assessmentId);
    }
    
}
